package org.jb.coinche.server.business;

import java.util.ArrayList;
import java.util.Collections;

import org.jb.coinche.client.business.model.Card;

public class Deck {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8821503178124077405L;

	/*
	 * 
	 */
	public Deck() {
		
		for( Card.Color color : Card.Color.values() ) {
			for( Card.Value value : Card.Value.values() ) {
				
				cards.add( new Card( color, value ) );
			}
		}
		
		Collections.shuffle( cards ); // Il faudrait plutot rendre aleatoire getCard() ...
	}
	
	/*
	 * 
	 */
	public Card getCard() {
		return cards.remove(0);
	}
	
	private ArrayList<Card> cards = new ArrayList<Card>();
}
